﻿@model BackEndCmsPagesEdit
<div class="row">
    <div class="col-lg-12">
        @using (Html.BootstrapBeginForm())
        {
            <div class="panel panel-default">
                <div class="panel-heading">
                    @if (ViewData.IsFormVisible())
                    {
                        <text>
                            @Html.BootstrapSubmit(isConfirmActive: true)
                            @Html.BootstrapResetForm()
                        </text>
                    }
                    @Html.BootstrapButtonRedirect("/Admin/CmsPages", MVCwCMS.Resources.Strings.CmsPages)
                </div>
                <div class="panel-body">

                    @Html.AntiForgeryToken()
                    @Html.BootstrapValidationSummary()

                    @if (ViewData.IsFormVisible())
                    {
                        <div class="col-lg-6">
                            @{
                                CmsPages CmsPages = new CmsPages();
                                var selectListBackEndCmsPages = new SelectList(CmsPages.GetAllPages(true), "PageId", "PageName", Model.PageParentId);
                            }
                            @Html.BootstrapDropDownListFor(m => m.PageParentId, selectListBackEndCmsPages, MVCwCMS.Resources.Strings.NoParent)

                            @Html.BootstrapTextBoxFor(m => m.PageName)

                            @{
                                PageTemplates pageTemplates = new PageTemplates();
                                var selectListBackEndPageTemplates = new SelectList(pageTemplates.GetAllPageTemplates(isActive: true), "PageTemplateId", "Title");
                            }
                            @Html.BootstrapDropDownListFor(m => m.PageTemplateId, selectListBackEndPageTemplates, "Specified URL", className: "OnChangePageTemplateId")

                            <div class="form-group">
                                @Html.BootstrapTextBoxFor(m => m.Segment)
                                <div class="row text-right">
                                    <div class="col-xs-12">
                                        <button type="button" id="SegmentBtn" class="btn btn-default btn-sm set-segment">Get from Page name</button>
                                    </div>
                                </div>
                            </div>

                            @Html.BootstrapTextBoxFor(m => m.Url)

                            @Html.BootstrapDropDownListFor(m => m.Target, FormHelper.GetSelectListForTarget(FormHelper.SelectedValueForTarget.SameWindow))

                            @Html.BootstrapCheckBoxFor(m => m.ShowInMainMenu)

                            @Html.BootstrapCheckBoxFor(m => m.ShowInBottomMenu)

                            @Html.BootstrapCheckBoxFor(m => m.ShowInSitemap)

                            @Html.BootstrapCheckBoxFor(m => m.IsActive)

                            @Html.BootstrapCheckBoxFor(m => m.IsAccessRestricted)

                            @Html.BootstrapCheckBoxFor(m => m.IsHomePage)
                        </div>
                    }   
                </div>
            </div>
        }
    </div>
</div>